﻿
<script type="text/javascript">
    function HomeCourseCtrl($scope, $http) {
        var uri = "/api/Courses/@ViewBag.CourseId";
        $http.get(uri).success(function (data) {
            $scope.data = data;
        }).error(function(header, status, data, config){
            window.alert("Greska u konekciji sa serverom");
        });
    }
</script>



<div class="container">
    


    <div ng-controller="HomeCourseCtrl" class="col-md-8 col-lg-push-2">
        <div class="panel">
            <h2 class="panel-heading">{{data.Course.CouseName}}</h2>
            <div class="panel-body">

                <div class="row">
                    <div ng-repeat="lesson in data.Lessons" class="col-md-4">

                        <div class="thumbnail">
                            <div class="caption">
                                <h4>{{lesson.LessonName}}</h4>
                                <p> <!--{{lesson.NumberOfParts}} --></p>
                                <a class="btn btn-success" href="/Home/Lesson/{{lesson.LessonId}}">Započni lekciju</a>
                            </div>
                        </div>

                    </div>

                </div>

            </div>

        </div>
    </div>


</div>
